
//-------------------------------------------------------------------
// Helper functions

Val* iter_src(Val* i) {
	return (Val*)r->data.IterData.src;
}

Val* iter_val(Val* i) {
	return (Val*)r->data.IterData.val;
}

byte* iter_ptr(Val* i) {
	return r->data.IterData.ptr;
}

int iter_is_func(Val* i) {
	return iter_src(i)->type == func_type;
}

int iter_val_size(Val* i) {
	assert(val_is_seq(iter_src(i)));
	return seq_element_size(i);
}

//-------------------------------------------------------------------
// Iterator functions

Val* input_iter_new(VM* vm, Val* x) {
	Val* r = val_new(IterType);
	r->data.IterData.src = x;
}

Val* input_iter_get_val(Val* i) {
	assert(r->data.IterData.src);
	return r->data.IterData.val;
}

int input_iter_goto_next(VM* vm, Val* i) {
	if (iter
}

Val* output_iter_new(VM* vm, Val* x) {
	Val* r = val_new(IterType);

	switch (x->type)
	{
	case VByteType:
	case VIntType:
	case VFloatType:
	case VDoubleType:
	case ObjectType:
	case FunctionType:
	}
}

void output_iter_set_val(VM* vm, Val* i, Val* x) {
}

void output_iter_goto_next(VM* vm, Val* i) {
}
